/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author owtee
 */
@Entity
@Table(name = "menu")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Menu.findAll", query = "SELECT m FROM Menu m"),
    @NamedQuery(name = "Menu.findByMenuRole", query = "SELECT m FROM Menu m WHERE m.menuPK.menuRole = :menuRole"),
    @NamedQuery(name = "Menu.findByMenuName", query = "SELECT m FROM Menu m WHERE m.menuPK.menuName = :menuName"),
    @NamedQuery(name = "Menu.findByMenuSeq", query = "SELECT m FROM Menu m WHERE m.menuSeq = :menuSeq"),
    @NamedQuery(name = "Menu.findByMenuNameLink", query = "SELECT m FROM Menu m WHERE m.menuNameLink = :menuNameLink"),
    @NamedQuery(name = "Menu.findByMenuLink", query = "SELECT m FROM Menu m WHERE m.menuLink = :menuLink"),
    @NamedQuery(name = "Menu.findByMenuClass", query = "SELECT m FROM Menu m WHERE m.menuClass = :menuClass"),
    @NamedQuery(name = "Menu.findByCreateUser", query = "SELECT m FROM Menu m WHERE m.createUser = :createUser"),
    @NamedQuery(name = "Menu.findByCreateDate", query = "SELECT m FROM Menu m WHERE m.createDate = :createDate"),
    @NamedQuery(name = "Menu.findByModifyUser", query = "SELECT m FROM Menu m WHERE m.modifyUser = :modifyUser"),
    @NamedQuery(name = "Menu.findByModifyDate", query = "SELECT m FROM Menu m WHERE m.modifyDate = :modifyDate")})
public class Menu implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected MenuPK menuPK;
    @Column(name = "Menu_Seq")
    private Integer menuSeq;
    @Size(max = 50)
    @Column(name = "Menu_Name_Link")
    private String menuNameLink;
    @Size(max = 50)
    @Column(name = "Menu_Link")
    private String menuLink;
    @Size(max = 20)
    @Column(name = "Menu_Class")
    private String menuClass;
    @Size(max = 10)
    @Column(name = "Create_User")
    private String createUser;
    @Column(name = "Create_Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;
    @Size(max = 10)
    @Column(name = "Modify_User")
    private String modifyUser;
    @Column(name = "Modify_Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date modifyDate;

    public Menu() {
    }

    public Menu(MenuPK menuPK) {
        this.menuPK = menuPK;
    }

    public Menu(String menuRole, String menuName) {
        this.menuPK = new MenuPK(menuRole, menuName);
    }

    public MenuPK getMenuPK() {
        return menuPK;
    }

    public void setMenuPK(MenuPK menuPK) {
        this.menuPK = menuPK;
    }

    public Integer getMenuSeq() {
        return menuSeq;
    }

    public void setMenuSeq(Integer menuSeq) {
        this.menuSeq = menuSeq;
    }

    public String getMenuNameLink() {
        return menuNameLink;
    }

    public void setMenuNameLink(String menuNameLink) {
        this.menuNameLink = menuNameLink;
    }

    public String getMenuLink() {
        return menuLink;
    }

    public void setMenuLink(String menuLink) {
        this.menuLink = menuLink;
    }

    public String getMenuClass() {
        return menuClass;
    }

    public void setMenuClass(String menuClass) {
        this.menuClass = menuClass;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getModifyUser() {
        return modifyUser;
    }

    public void setModifyUser(String modifyUser) {
        this.modifyUser = modifyUser;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (menuPK != null ? menuPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Menu)) {
            return false;
        }
        Menu other = (Menu) object;
        if ((this.menuPK == null && other.menuPK != null) || (this.menuPK != null && !this.menuPK.equals(other.menuPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Menu[ menuPK=" + menuPK + " ]";
    }
    
}
